home *** CD-ROM | disk | FTP | other *** search
/ Merciful 5 / Merciful - Disc 5.iso / software / p / pcqpascalv1.2d.lha / Include / Workbench / Workbench.i < prev    next >
Encoding:
Text File  |  1997-05-07  |  6.4 KB  |  192 lines

  1. {
  2.         Workbench.i for PCQ Pascal
  3. }
  4.  
  5. {$I   "Include:Exec/Nodes.i"}
  6. {$I   "Include:Exec/Lists.i"}
  7. {$I   "Include:Exec/Tasks.i"}
  8. {$I   "Include:Intuition/Intuition.i"}
  9. {$I   "Include:WorkBench/Startup.i"}
  10. {$I   "Include:DOS/DOS.i"}
  11. {$I   "Include:Workbench/WorkbenchBaseVar.i"}
  12.  
  13. Const
  14.  
  15.     WBDISK              = 1;
  16.     WBDRAWER            = 2;
  17.     WBTOOL              = 3;
  18.     WBPROJECT           = 4;
  19.     WBGARBAGE           = 5;
  20.     WBDEVICE            = 6;
  21.     WBKICK              = 7;
  22.     WBAPPICON           = 8;
  23.  
  24. Type
  25.  
  26.     OldDrawerData = record
  27.         dd_NewWindow    : NewWindow;    { args to open window }
  28.         dd_CurrentX     : Integer;      { current x coordinate of origin }
  29.         dd_CurrentY     : Integer;      { current y coordinate of origin }
  30.     end;
  31.     OldDrawerDataPtr = ^OldDrawerData;
  32.  
  33. Const
  34.  
  35. { the amount of DrawerData actually written to disk }
  36.  
  37.     OLDDRAWERDATAFILESIZE  = 56;  { sizeof(OldDrawerData) }
  38.  
  39. Type
  40.     DrawerData = record
  41.         dd_NewWindow    : NewWindow;    { args to open window }
  42.         dd_CurrentX     : Integer;      { current x coordinate of origin }
  43.         dd_CurrentY     : Integer;      { current y coordinate of origin }
  44.         dd_Flags        : Integer;      { flags for drawer }
  45.         dd_ViewModes    : Short;        { view mode for drawer }
  46.     end;
  47.     DrawerDataPtr = ^DrawerData;
  48.  
  49. Const
  50.  
  51. { the amount of DrawerData actually written to disk }
  52.  
  53.     DRAWERDATAFILESIZE  = 62;  { sizeof(DrawerData) }
  54.  
  55.  
  56. Type
  57.  
  58.     DiskObject = record
  59.         do_Magic        : Short;        { a magic number at the start of the file }
  60.         do_Version      : Short;        { a version number, so we can change it }
  61.         do_Gadget       : Gadget;       { a copy of in core gadget }
  62.         do_Type         : Byte;
  63.         do_DefaultTool  : String;
  64.         do_ToolTypes    : Address;
  65.         do_CurrentX     : Integer;
  66.         do_CurrentY     : Integer;
  67.         do_DrawerData   : DrawerDataPtr;
  68.         do_ToolWindow   : String;       { only applies to tools }
  69.         do_StackSize    : Integer;      { only applies to tools }
  70.     end;
  71.     DiskObjectPtr = ^DiskObject;
  72.  
  73. Const
  74.  
  75.     WB_DISKMAGIC        = $e310;        { a magic number, not easily impersonated }
  76.     WB_DISKVERSION      = 1;            { our current version number }
  77.     WB_DISKREVISION     = 1;            { our current revision number }
  78.   {I only use the lower 8 bits of Gadget.UserData for the revision # }
  79.     WB_DISKREVISIONMASK = 255;
  80. Type
  81.  
  82.     FreeList = record
  83.         fl_NumFree      : Short;
  84.         fl_MemList      : List;
  85.     end;
  86.     FreeListPtr = FreeList;
  87.  
  88. Const
  89.  
  90. { each message that comes into the WorkBenchPort must have a type field
  91.  * in the preceeding short.  These are the defines for this type
  92.  }
  93.  
  94.     MTYPE_PSTD          = 1;    { a "standard Potion" message }
  95.     MTYPE_TOOLEXIT      = 2;    { exit message from our tools }
  96.     MTYPE_DISKCHANGE    = 3;    { dos telling us of a disk change }
  97.     MTYPE_TIMER         = 4;    { we got a timer tick }
  98.     MTYPE_CLOSEDOWN     = 5;    { <unimplemented> }
  99.     MTYPE_IOPROC        = 6;    { <unimplemented> }
  100.     MTYPE_APPWINDOW     = 7;    {     msg from an app window }
  101.     MTYPE_APPICON       = 8;    {     msg from an app icon }
  102.     MTYPE_APPMENUITEM   = 9;    {     msg from an app menuitem }
  103.     MTYPE_COPYEXIT      = 10;   {     exit msg from copy process }
  104.     MTYPE_ICONPUT       = 11;   {     msg from PutDiskObject in icon.library }
  105.  
  106.  
  107. { workbench does different complement modes for its gadgets.
  108.  * It supports separate images, complement mode, and backfill mode.
  109.  * The first two are identical to intuitions GADGIMAGE and GADGHCOMP.
  110.  * backfill is similar to GADGHCOMP, but the region outside of the
  111.  * image (which normally would be color three when complemented)
  112.  * is flood-filled to color zero.
  113.  }
  114.  
  115.     GFLG_GADGBACKFILL   = $0001;
  116.     GADGBACKFILL        = $0001;   { an old synonym }
  117.  
  118. { if an icon does not really live anywhere, set its current position
  119.  * to here
  120.  }
  121.  
  122.     NO_ICON_POSITION    = $80000000;
  123.  
  124. {    workbench now is a library.  this is it's name }
  125. CONST
  126.  WORKBENCH_NAME    =      "workbench.library";
  127.  
  128. {    If you find am_Version >= AM_VERSION, you know this structure has
  129.  * at least the fields defined in this version of the include file
  130.  }
  131.  AM_VERSION   =   1;
  132.  
  133. Type
  134.    AppMessage = Record
  135.     am_Message       : Message;            {    standard message structure }
  136.     am_Type          : Short;              {    message type }
  137.     am_UserData      : Integer;            {    application specific }
  138.     am_ID            : Integer;            {    application definable ID }
  139.     am_NumArgs       : Integer;            {    # of elements in arglist }
  140.     am_ArgList       : WBArgListPtr;       {    the arguements themselves }
  141.     am_Version       : Short;              {    will be AM_VERSION }
  142.     am_Class         : Short;              {    message class }
  143.     am_MouseX        : Short;              {    mouse x position of event }
  144.     am_MouseY        : Short;              {    mouse y position of event }
  145.     am_Seconds       : Integer;            {    current system clock time }
  146.     am_Micros        : Integer;            {    current system clock time }
  147.     am_Reserved      : Array[0..7] of Integer;       {    avoid recompilation }
  148.    END;
  149.    AppMessagePtr = ^AppMessage;
  150.  
  151. {
  152.  * The following structures are private.  These are just stub
  153.  * structures for code compatibility...
  154.  }
  155.  AppWindow = Record aw_PRIVATE : Address; END;
  156.  AppWindowPtr = ^AppWindow;
  157.  AppIcon = Record ai_PRIVATE : Address; END;
  158.  AppIconPtr = ^AppIcon;
  159.  AppMenuItem = Record ami_PRIVATE : Address; END;
  160.  AppMenuItemPtr = ^AppMenuItem;
  161.  
  162.  
  163.  FUNCTION AddAppWindowA(ID, UserData : Integer; Win : WindowPtr; 
  164.                         Port : MsgPortPtr; TagList : Address) : AppWindowPtr;
  165.   External;
  166.  
  167.  FUNCTION RemoveAppWindow(AppWin : AppWindowPtr) : Boolean;
  168.   External;
  169.  
  170.  FUNCTION AddAppIconA(ID, UserData : Integer; Txt : String; Port : MsgPortPtr;
  171.                       FL : FileLock; diskobj : DiskObjectPtr; taglist : Address) : AppIconPtr;
  172.   External;
  173.  
  174.  FUNCTION RemoveAppIcon(AIcon : AppIconPtr) : Boolean;
  175.   External;
  176.  
  177.  FUNCTION AddAppMenuItem(ID, UserData : Integer; Txt : String; Port : MsgPortPtr;
  178.                          taglist : Address) : AppMenuItemPtr;
  179.   External;
  180.  
  181.  FUNCTION RemoveAppMenuItem(AppMI : AppMenuItemPtr) : Boolean;
  182.   External;
  183.  
  184.  
  185.  { --- functions in V39 or higher (Release 3) --- }
  186.  
  187.  PROCEDURE WBInfo(l : Address; name : String; Scr : ScreenPtr);
  188.                  { l = lock }
  189.     External;
  190.  
  191.  
  192.